Teacher Version

Hero Image
Hero Image

Traffic Signal Challenge Rules

Introduction

In this challenge, you will program your EV3 robot through three different intersections, each of which has a traffic signal. The traffic signal, which can be either the colored block or the red/green card, is held by hand at a set height. Unlike a camera, the detection range of the Color Sensor is short, so you will need to modify its placement on the robot so that it can see the traffic signal and react appropriately.

Rules and Procedures:

  • Traffic signals are represented by holding the colored block with the signal side downward and toward the robot at a 45-degree angle.
  • You can also use red and green colored sheets of paper, which may be easier to hold at the correct height.
  • The initial signal color for each intersection is determined by flipping three coins before the run. Heads = green, tails = red.
  • The robot MUST stop if the light is red, and MUST NOT stop if the light is green.
  • After the robot successfully traveled through all three intersections, the robot can be stopped by hand.
  • BONUS: Write the program so that it DOES always stop after going through the third intersection. This will require the use of an If and Else block.

Hints:

  • Since you only have access to wait commands, try to break the robot’s behavior into stages. What is the robot waiting to see at each stage of its movement? What should its motors be doing during those stages?
  • If the robot is already moving, is there any point in waiting for green? If the robot is stopped, is there any point in waiting for red?
  • If the robot sees a red light, don’t forget that it needs to wait for the actual green light before proceeding!

© 2016 Robomatter, Inc.

Portions of this product are manufactured under license from Carnegie Mellon University.